package com.t.bricks.bussiness.db.entity.customer.base;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.t.bricks.annotation.DataInfo;
import com.t.bricks.utils.function.data.MoneyUtil;
import com.t.bricks.utils.function.date.TimeUtil;
import com.t.bricks.utils.function.encode.MD5Util;

/**
 * 顾客账户'CustomerAccount'表实体类
 * 警告:非数据库字段禁止在此添加,应该创建扩展实体中添加
 * @author HuangXinBian
 * @DateTime 2022年07月01日 09:14:00
 */
@ApiModel("顾客账户CustomerAccount")
@DataInfo(sDbName="BricksMall", sTableName="CustomerAccount")
public class CustomerAccountBase implements Serializable {

	private static final long serialVersionUID = 1L;// 使用rmi时需修改

	/**
	 * 记录编号
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sId", sComment="记录编号", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=true, isNull=false,
		iMaxLength=8, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=0 )
	@ApiModelProperty(value="记录编号", example="")
	//[end]
	protected String sId;

	/**
	 * 支付密码(加密)
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sPayPass", sComment="支付密码(加密)", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=false,
		iMaxLength=32, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=1 )
	@ApiModelProperty(value="支付密码(加密)", example="")
	//[end]
	protected String sPayPass;

	/**
	 * 支付手势密码(加密)
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sPaySignPass", sComment="支付手势密码(加密)", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=32, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=2 )
	@ApiModelProperty(value="支付手势密码(加密)", example="")
	//[end]
	protected String sPaySignPass;
	
	/**
	 * 余额(元)
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="mFund", sComment="余额(元)", isDbField=true, sDbFileType="decimal",
		sDefaultData="0.00", isExtra=false, iskey=false, isNull=false,
		iMaxLength=10, isDecimal=false, iIntegralLength=6, iDecimalLength=2, iIndex=3 )
	@ApiModelProperty(value="余额(元)", example="0.00")
	//[end]
	protected BigDecimal mFund;

	/**
	 * 积分
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="iTally", sComment="积分", isDbField=true, sDbFileType="int",
		sDefaultData="0", isExtra=false, iskey=false, isNull=false,
		iMaxLength=100, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=4 )
	@ApiModelProperty(value="积分", example="0")
	//[end]
	protected Integer iTally;

	/**
	 * 保密问题1
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sQuestion1", sComment="保密问题1", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=20, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=5 )
	@ApiModelProperty(value="保密问题1", example="")
	//[end]
	protected String sQuestion1;

	/**
	 * 保密答案1
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sAnswer1", sComment="保密答案1", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=20, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=6 )
	@ApiModelProperty(value="保密答案1", example="")
	//[end]
	protected String sAnswer1;

	/**
	 * 保密问题2
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sQuestion2", sComment="保密问题2", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=20, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=7 )
	@ApiModelProperty(value="保密问题2", example="")
	//[end]
	protected String sQuestion2;

	/**
	 * 保密答案2
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sAnswer2", sComment="保密答案2", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=20, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=8 )
	@ApiModelProperty(value="保密答案2", example="")
	//[end]
	protected String sAnswer2;

	/**
	 * 保密问题3
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sQuestion3", sComment="保密问题3", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=20, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=9 )
	@ApiModelProperty(value="保密问题3", example="")
	//[end]
	protected String sQuestion3;

	/**
	 * 保密答案3
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sAnswer3", sComment="保密答案3", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=20, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=10 )
	@ApiModelProperty(value="保密答案3", example="")
	//[end]
	protected String sAnswer3;

	/**
	 * 备注
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sMemo", sComment="备注", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=true,
		iMaxLength=200, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=11 )
	@ApiModelProperty(value="备注", example="")
	//[end]
	protected String sMemo;

	/**
	 * 创建人
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sCreator", sComment="创建人", isDbField=true, sDbFileType="varchar",
		sDefaultData="00000001", isExtra=false, iskey=false, isNull=false,
		iMaxLength=8, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=12 )
	@ApiModelProperty(value="创建人", example="00000001")
	//[end]
	protected String sCreator;

	/**
	 * 创建日期
	 */
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//解决表单提交时字符串时间值错误
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="dCreateDate", sComment="创建日期", isDbField=true, sDbFileType="datetime",
		sDefaultData="", isExtra=false, iskey=false, isNull=false,
		iMaxLength=23, isDecimal=false, iIntegralLength=-1, iDecimalLength=-1, iIndex=13 )
	@ApiModelProperty(value="创建日期", example="")
	//[end]
	protected Date dCreateDate;

	/**
	 * 修改人
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sModifieder", sComment="修改人", isDbField=true, sDbFileType="varchar",
		sDefaultData="00000001", isExtra=false, iskey=false, isNull=false,
		iMaxLength=8, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=14 )
	@ApiModelProperty(value="修改人", example="00000001")
	//[end]
	protected String sModifieder;

	/**
	 * 修改日期
	 */
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//解决表单提交时字符串时间值错误
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="dModifiedDate", sComment="修改日期", isDbField=true, sDbFileType="datetime",
		sDefaultData="", isExtra=false, iskey=false, isNull=false,
		iMaxLength=23, isDecimal=false, iIntegralLength=-1, iDecimalLength=-1, iIndex=15 )
	@ApiModelProperty(value="修改日期", example="")
	//[end]
	protected Date dModifiedDate;

	/**
	 * 状态
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="iState", sComment="状态", isDbField=true, sDbFileType="int",
		sDefaultData="1", isExtra=false, iskey=false, isNull=false,
		iMaxLength=100, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=16 )
	@ApiModelProperty(value="状态", example="1")
	//[end]
	protected Integer iState;

	/**
	 * 序号
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="iIndex", sComment="序号", isDbField=true, sDbFileType="int",
		sDefaultData="1", isExtra=false, iskey=false, isNull=false,
		iMaxLength=100, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=17 )
	@ApiModelProperty(value="序号", example="1")
	//[end]
	protected Integer iIndex;

	/**
	 * 版本
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="iVersion", sComment="版本", isDbField=true, sDbFileType="int",
		sDefaultData="1", isExtra=false, iskey=false, isNull=false,
		iMaxLength=100, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=18 )
	@ApiModelProperty(value="版本", example="1")
	//[end]
	protected Integer iVersion;

	/**
	 * 记录验证串
	 */
	//[start]
	@DataInfo( sDbName="BricksMall", sTableName="CustomerAccount",
		sName="sRecordKey", sComment="记录验证串", isDbField=true, sDbFileType="varchar",
		sDefaultData="", isExtra=false, iskey=false, isNull=false,
		iMaxLength=32, isDecimal=false, iIntegralLength=2, iDecimalLength=2, iIndex=19 )
	@ApiModelProperty(value="记录验证串", example="")
	//[end]
	protected String sRecordKey;

	/**
	 * 取 记录编号
	 * @return String
	 */
	public String getsId() {
		return sId;
	}

	/**
	 * 设置记录编号
	 * @param sId
	 */
	public void setsId(String sId) {
		this.sId = sId;
	}

	/**
	 * 取 支付密码(加密)
	 * @return String
	 */
	public String getsPayPass() {
		return sPayPass;
	}

	/**
	 * 设置支付密码(加密)
	 * @param sPayPass
	 */
	public void setsPayPass(String sPayPass) {
		this.sPayPass = sPayPass;
	}

	/**
	 * 取 支付手势密码(加密)
	 * @return String
	 */
	public String getsPaySignPass() {
		return sPaySignPass;
	}

	/**
	 * 设置支付手势密码(加密)
	 * @param sPaySignPass
	 */
	public void setsPaySignPass(String sPaySignPass) {
		this.sPaySignPass = sPaySignPass;
	}

	/**
	 * 取 余额(元)
	 * @return Long
	 */
	public BigDecimal getmFund() {
		return mFund;
	}

	/**
	 * 设置 余额(元)
	 * @param mFund
	 */
	public void setmFund(BigDecimal mFund) {
		this.mFund = mFund;
	}

	/**
	 * 取 积分
	 * @return Integer
	 */
	public Integer getiTally() {
		return iTally;
	}

	/**
	 * 设置积分
	 * @param iTally
	 */
	public void setiTally(Integer iTally) {
		this.iTally = iTally;
	}

	/**
	 * 取 保密问题1
	 * @return String
	 */
	public String getsQuestion1() {
		return sQuestion1;
	}

	/**
	 * 设置保密问题1
	 * @param sQuestion1
	 */
	public void setsQuestion1(String sQuestion1) {
		this.sQuestion1 = sQuestion1;
	}

	/**
	 * 取 保密答案1
	 * @return String
	 */
	public String getsAnswer1() {
		return sAnswer1;
	}

	/**
	 * 设置保密答案1
	 * @param sAnswer1
	 */
	public void setsAnswer1(String sAnswer1) {
		this.sAnswer1 = sAnswer1;
	}

	/**
	 * 取 保密问题2
	 * @return String
	 */
	public String getsQuestion2() {
		return sQuestion2;
	}

	/**
	 * 设置保密问题2
	 * @param sQuestion2
	 */
	public void setsQuestion2(String sQuestion2) {
		this.sQuestion2 = sQuestion2;
	}

	/**
	 * 取 保密答案2
	 * @return String
	 */
	public String getsAnswer2() {
		return sAnswer2;
	}

	/**
	 * 设置保密答案2
	 * @param sAnswer2
	 */
	public void setsAnswer2(String sAnswer2) {
		this.sAnswer2 = sAnswer2;
	}

	/**
	 * 取 保密问题3
	 * @return String
	 */
	public String getsQuestion3() {
		return sQuestion3;
	}

	/**
	 * 设置保密问题3
	 * @param sQuestion3
	 */
	public void setsQuestion3(String sQuestion3) {
		this.sQuestion3 = sQuestion3;
	}

	/**
	 * 取 保密答案3
	 * @return String
	 */
	public String getsAnswer3() {
		return sAnswer3;
	}

	/**
	 * 设置保密答案3
	 * @param sAnswer3
	 */
	public void setsAnswer3(String sAnswer3) {
		this.sAnswer3 = sAnswer3;
	}

	/**
	 * 取 备注
	 * @return String
	 */
	public String getsMemo() {
		return sMemo;
	}

	/**
	 * 设置备注
	 * @param sMemo
	 */
	public void setsMemo(String sMemo) {
		this.sMemo = sMemo;
	}

	/**
	 * 取 创建人
	 * @return String
	 */
	public String getsCreator() {
		return sCreator;
	}

	/**
	 * 设置创建人
	 * @param sCreator
	 */
	public void setsCreator(String sCreator) {
		this.sCreator = sCreator;
	}

	/**
	 * 取 创建日期
	 * @return Date
	 */
	public Date getdCreateDate() {
		return dCreateDate;
	}

	/**
	 * 设置创建日期
	 * @param dCreateDate
	 */
	public void setdCreateDate(Date dCreateDate) {
		this.dCreateDate = dCreateDate;
	}

	/**
	 * 取 修改人
	 * @return String
	 */
	public String getsModifieder() {
		return sModifieder;
	}

	/**
	 * 设置修改人
	 * @param sModifieder
	 */
	public void setsModifieder(String sModifieder) {
		this.sModifieder = sModifieder;
	}

	/**
	 * 取 修改日期
	 * @return Date
	 */
	public Date getdModifiedDate() {
		return dModifiedDate;
	}

	/**
	 * 设置修改日期
	 * @param dModifiedDate
	 */
	public void setdModifiedDate(Date dModifiedDate) {
		this.dModifiedDate = dModifiedDate;
	}

	/**
	 * 取 状态
	 * @return Integer
	 */
	public Integer getiState() {
		return iState;
	}

	/**
	 * 设置状态
	 * @param iState
	 */
	public void setiState(Integer iState) {
		this.iState = iState;
	}

	/**
	 * 取 序号
	 * @return Integer
	 */
	public Integer getiIndex() {
		return iIndex;
	}

	/**
	 * 设置序号
	 * @param iIndex
	 */
	public void setiIndex(Integer iIndex) {
		this.iIndex = iIndex;
	}

	/**
	 * 取 版本
	 * @return Integer
	 */
	public Integer getiVersion() {
		return iVersion;
	}

	/**
	 * 设置版本
	 * @param iVersion
	 */
	public void setiVersion(Integer iVersion) {
		this.iVersion = iVersion;
	}

	/**
	 * 取 记录验证串
	 * @return String
	 */
	public String getsRecordKey() {
		return sRecordKey;
	}

	/**
	 * 设置记录验证串
	 * @param sRecordKey
	 */
	public void setsRecordKey(String sRecordKey) {
		this.sRecordKey = sRecordKey;
	}

	/**
	 * 创建当前'记录验证串'
	 * @param key 加密密钥
	 * @return String 子节点集合
	 */
	public String createRecordKey(String key) {
		StringBuilder sb = new StringBuilder(1000);
		
		sb.append(null != this.sId ? String.valueOf(this.sId) : "").append(";");
		sb.append(null != this.sPayPass ? String.valueOf(this.sPayPass) : "").append(";");
		sb.append(null != this.sPaySignPass ? String.valueOf(this.sPaySignPass) : "").append(";");
		sb.append(null != this.mFund ? MoneyUtil.BigDecimal2String(this.mFund, 2) : "").append(";");
		sb.append(null != this.iTally ? String.valueOf(this.iTally) : "").append(";");
		sb.append(null != this.sQuestion1 ? String.valueOf(this.sQuestion1) : "").append(";");
		sb.append(null != this.sAnswer1 ? String.valueOf(this.sAnswer1) : "").append(";");
		sb.append(null != this.sQuestion2 ? String.valueOf(this.sQuestion2) : "").append(";");
		sb.append(null != this.sAnswer2 ? String.valueOf(this.sAnswer2) : "").append(";");
		sb.append(null != this.sQuestion3 ? String.valueOf(this.sQuestion3) : "").append(";");
		sb.append(null != this.sAnswer3 ? String.valueOf(this.sAnswer3) : "").append(";");
		sb.append(null != this.sCreator ? String.valueOf(this.sCreator) : "").append(";");
		sb.append(null != this.dCreateDate ? TimeUtil.toStr(this.dCreateDate, "YYYY-MM-dd HH:mm:00") : "").append(";");
		sb.append(null != this.sModifieder ? String.valueOf(this.sModifieder) : "").append(";");
		sb.append(null != this.dModifiedDate ? TimeUtil.toStr(this.dModifiedDate, "YYYY-MM-dd HH:mm:00") : "").append(";");
		sb.append(null != this.iState ? String.valueOf(this.iState) : "").append(";");
		sb.append(null != this.iIndex ? String.valueOf(this.iIndex) : "").append(";");
		sb.append(null != this.iVersion ? String.valueOf(this.iVersion) : "").append(";");
		sb.append(key);

		return MD5Util.MD5(sb.toString());
	}
	
}
